<!--
所需数据：
// 扇区分类：年龄段
data: ['<19','19-29','29-39','39-49','>49']

// 扇区对应的大小
data:[
    {value:335, name:'<19'},
    {value:310, name:'19-29'},
    {value:234, name:'29-39'},
    {value:135, name:'39-49'},
    {value:1548, name:'>49'}
],

-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>年龄构成</title>
    <!-- 引入jquery文件 -->
    <script src="../js/jquery-3.1.1.js"></script>
    <!-- 引入 ECharts 文件 -->
    <script src="../js/echarts.js"></script>
</head>
<body>
<div id="chart" style="width: 800px;height:600px;"></div>

<script>
    // JS
    var chart = echarts.init(document.getElementById('chart'));

    option = {
        title : {
            text: '年龄构成',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} : {c} ({d}%)"
        },
        legend: {
            left: 'left',
            data: ['<19','19-29','29-39','39-49','>49']
        },
        series : [
            {
                name: '游客数量',
                type: 'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data:[
                    {value:335, name:'<19'},
                    {value:310, name:'19-29'},
                    {value:234, name:'29-39'},
                    {value:135, name:'39-49'},
                    {value:1548, name:'>49'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    chart.setOption(option);
</script>
</body>
</html>